package net.hn.hnms.biz.equipment.controller.open;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.api.feign.model.DataStateVo;
import net.hn.hnms.biz.api.mine.model.FanSystemVolumeAndSpeedDto;
import net.hn.hnms.biz.equipment.service.DrainageService;
import net.hn.hnms.biz.equipment.service.EquipmentService;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;

@ApiIgnore
@Api(value = "重大设备远程调用接口", tags = {"重大设备远程调用接口"})
@RestController
@RequestMapping("/fein")
public class FeinController {
    @Resource
    private DrainageService drainageService;
    @Resource
    private EquipmentService equipmentService;
    /**
     * 获取水泵房排水量的数据
     */
    @ApiOperation("获取水泵房排水量的数据")
    @GetMapping("/getDrainAwayWater")
    public BigDecimal getDrainAwayWater(@ApiParam(value = "煤矿编码") String mineCode) {
        BigDecimal value = drainageService.getDrainAwayWater(mineCode);
        return value;
    }


    /**
     * 获取水泵房排水量今日累计量的数据
     */
    @ApiOperation("获取水泵房排水量今日累计量的数据")
    @GetMapping("/getTodayAddDrainAwayWater")
    public BigDecimal getTodayAddDrainAwayWater(@ApiParam(value = "煤矿编码") String mineCode) {
        BigDecimal value = drainageService.getTodayAddDrainAwayWater(mineCode);
        return value;
    }
    @GetMapping("maxTime")
    @ApiOperation("数据最新时间")
    public R<List<DataStateVo>> getMaxTime(String mineCode, String companyCode,String sysName){
        return R.ok(equipmentService.getMaxTime( mineCode,companyCode,sysName));
    }
    @GetMapping("getFanSystemVolumeAndSpeedList")
    @ApiOperation("获取煤矿主通风机的状态、风速、风量数据")
    public R<List<FanSystemVolumeAndSpeedDto>> getFanSystemVolumeAndSpeedList(String mineCode){
        return R.ok(equipmentService.getFanSystemVolumeAndSpeedList(mineCode));
    }

}
